package org.apache.osgimaker.editors.conversions;

import java.util.ArrayList;
import java.util.List;

import org.apache.osgimaker.editors.model.Bundle;

public class BundleObjectListConverter<R> implements Converter<List<R>, Object> {

	public BundleObjectListConverter() {

	}

	public List<R> convert(Object input) throws IllegalArgumentException {
		List<R> result = new ArrayList<R>();

		List<Bundle> bundleList = (List<Bundle>) input;
		for (int i = 0; i < bundleList.size(); i++){
			result.add( (R)bundleList.get(i).getId());
		}

		return result;
	}

}
